package com.study.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the forms database table.
 * 
 */
@Entity
@Table(name="forms")
@NamedQuery(name="Form.findAll", query="SELECT f FROM Form f")
public class Form implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="for_id")
	private int forId;

	@Column(name="for_browse")
	private int forBrowse;

	@Column(name="for_change")
	private int forChange;

	@Column(name="for_guest")
	private int forGuest;

	@Column(name="for_name")
	private String forName;

	@Temporal(TemporalType.DATE)
	@Column(name="for_time")
	private Date forTime;

	//bi-directional many-to-one association to FormsDetail
	@OneToMany(mappedBy="form")
	private List<FormsDetail> formsDetails;

	public Form() {
	}

	public int getForId() {
		return this.forId;
	}

	public void setForId(int forId) {
		this.forId = forId;
	}

	public int getForBrowse() {
		return this.forBrowse;
	}

	public void setForBrowse(int forBrowse) {
		this.forBrowse = forBrowse;
	}

	public int getForChange() {
		return this.forChange;
	}

	public void setForChange(int forChange) {
		this.forChange = forChange;
	}

	public int getForGuest() {
		return this.forGuest;
	}

	public void setForGuest(int forGuest) {
		this.forGuest = forGuest;
	}

	public String getForName() {
		return this.forName;
	}

	public void setForName(String forName) {
		this.forName = forName;
	}

	public Date getForTime() {
		return this.forTime;
	}

	public void setForTime(Date forTime) {
		this.forTime = forTime;
	}

	public List<FormsDetail> getFormsDetails() {
		return this.formsDetails;
	}

	public void setFormsDetails(List<FormsDetail> formsDetails) {
		this.formsDetails = formsDetails;
	}

	public FormsDetail addFormsDetail(FormsDetail formsDetail) {
		getFormsDetails().add(formsDetail);
		formsDetail.setForm(this);

		return formsDetail;
	}

	public FormsDetail removeFormsDetail(FormsDetail formsDetail) {
		getFormsDetails().remove(formsDetail);
		formsDetail.setForm(null);

		return formsDetail;
	}

}